import Vue from 'vue';
import Router from 'vue-router';
import login from '@/views/login';
import index from '@/views/index';
import empty from '@/views/empty';
Vue.use(Router);

const routes = [
  {
    name: 'login',
    path: '/login',
    components: {
      default: login,
      globalView: login
    }
  },
  {
    name: 'index',
    path: '/index',
    components: {
      globalView: index
    }
  },
  {
    name: 'empty',
    path: '/empty',
    components: {
      globalView: empty
    }
  },
  {
    name: 'data_list',
    path: '/list',
    component: () => import('@/views/list')
  },
  {
    name: 'project_manage',
    path: '/manage',
    component: () => import('@/views/manage')
  },
  {
    name: 'extra_list',
    path: '/analysis',
    component: () => import('@/views/analysis')
  },
  {
    name: 'user_stastics',
    path: '/stastics',
    component: () => import('@/views/stastics')
  },
  {
    name: 'user_charts',
    path: '/echarts',
    component: () => import('@/views/echarts')
  },
  {
    name: 'authority',
    path: '/authority',
    component: () => import('@/views/authority')
  },
  { path: '*',
    redirect: '/list'
  }
];
export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
});
